import MetaTrader5 as mt5
# 显示有关MetaTrader 5程序包的数据
print("MetaTrader5 package author: ",mt5.__author__)
print("MetaTrader5 package version: ",mt5.__version__)
 
# 建立MetaTrader 5到指定交易账户的连接
if not mt5.initialize(login=277203715,password="WANGhou@1234",server="Exness-MT5Trial5"):
    print("initialize() failed, error code =",mt5.last_error())
    quit()
 
# 显示有关连接状态、服务器名称和交易账户的数据
print("============登录成功========== ")
print(mt5.terminal_info())
# 显示有关MetaTrader 5版本的数据
print(mt5.version())
 
# 断开与MetaTrader 5程序端的连接
mt5.shutdown()